package com.forum.module.system.controller.admin.oauth2.vo.token;

import com.forum.framework.common.pojo.PageParams;
import io.swagger.v3.oas.annotations.media.Schema;

import java.util.Objects;

/**
 * 管理后台 - 访问令牌分页请求视图对象
 *
 * @author zihan.ouyang
 */
@Schema(description = "管理后台 - 访问令牌分页请求视图对象")
public class OAuth2AccessTokenPageReqVO extends PageParams {
    @Schema(description = "用户编号", requiredMode = Schema.RequiredMode.REQUIRED, example = "666")
    private Long userId;

    @Schema(description = "用户类型，参见 UserTypeEnum 枚举", requiredMode = Schema.RequiredMode.REQUIRED, example = "2")
    private Integer userType;

    @Schema(description = "客户端编号", requiredMode = Schema.RequiredMode.REQUIRED, example = "2")
    private String clientId;

    public Long getUserId() {
        return userId;
    }

    public void setUserId(Long userId) {
        this.userId = userId;
    }

    public Integer getUserType() {
        return userType;
    }

    public void setUserType(Integer userType) {
        this.userType = userType;
    }

    public String getClientId() {
        return clientId;
    }

    public void setClientId(String clientId) {
        this.clientId = clientId;
    }

    @Override
    public boolean equals(Object o) {
        if (this == o) return true;
        if (o == null || getClass() != o.getClass()) return false;
        OAuth2AccessTokenPageReqVO that = (OAuth2AccessTokenPageReqVO) o;
        return Objects.equals(userId, that.userId) && Objects.equals(userType, that.userType) && Objects.equals(clientId, that.clientId);
    }

    @Override
    public int hashCode() {
        return Objects.hash(userId, userType, clientId);
    }
}
